import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import source from './modules/source'
import user from './modules/user'
Vue.use(Vuex)
import createPersistedState from 'vuex-persistedstate'
const store = new Vuex.Store({
    modules: {
        app,
        settings,
        user,
        source
    },
    getters,
    plugins: [
        createPersistedState({
            storage: window.sessionStorage,
            reducer(state) {
                return {
                    source: state.source
                }
            }
        })
    ]
})

export default store